<template>
  <el-dialog
    top="30px"
    width="900px"
    class="dialog-sm"
    append-to-body
    :before-close="beforeClose"
    :close-on-click-modal="false"
    :title="dialogTitle"
    :visible.sync="visible"
  >
    <new-project :query-id="queryId" @close="beforeClose" @success="handleSuccess"></new-project>
  </el-dialog>
</template>

<script>
import NewProject from '@/bigcredit/views/program/components/new/NewProject'
export default {
  components: {
    NewProject,
  },
  props: {
    visible: Boolean,
    queryId: String,
  },
  data() {
    return {}
  },
  computed: {
    dialogTitle() {
      return this.queryId ? '修改项目信息' : '添加项目'
    },
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
    beforeClose() {
      this.$emit('update:visible', false)
    },
    handleSuccess() {
      this.$emit('success', true)
    },
  },
}
</script>

<style lang="scss" scoped></style>
